class ChatController < ApplicationController
  layout "userinterface"
  
  before_filter :authorize
  
  def index
    @chatrooms = Chatroom.find(:all)
  end
  
  def create_chatroom
    if request.post?
      @chatroom = Chatroom.new(params[:chatroom])
      if @chatroom.save
        if change_room(@chatroom)
          redirect_to :controller => :chatroom
        else
          chat_error
        end
      else
        chat_error
      end
    end
  end

  
end
